package com.fowo.api.sys.controller;

import com.fowo.api.common.controller.CommonController;
import com.fowo.api.common.model.R;
import com.fowo.api.sys.model.*;
import com.fowo.api.sys.service.SysUserPermissionShopinfoService;
import com.fowo.api.sys.service.SysUserPermissionWarehouseService;
import com.fowo.api.sys.service.SysUserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Tag(name = "系统用户")
@RequestMapping("/api/sys/user")
@RestController
public class SysUserCustomController   {

    @Resource
    private SysUserService userService;
    @Resource
    private SysUserPermissionShopinfoService sysUserPermissionShopinfoService;
    @Resource
    private SysUserPermissionWarehouseService sysUserPermissionWarehouseService;


    @Operation(summary = "获取指定 id 的店铺记录")
    @GetMapping("getShopinfoById")
    public R<List<SysUserPermissionShopinfoVo>> getShopinfoById(@RequestParam(name = "id") Long id,
                                                                @RequestParam(name = "selected") String selectPlatform,
                                                                @RequestParam(name = "keywords", required = false) String keywords) {
        List<SysUserPermissionShopinfoVo> list = sysUserPermissionShopinfoService.getList(id, selectPlatform, keywords);
        return R.data(list);
    }

    @Operation(summary = "获取指定 id 的仓库记录")
    @GetMapping("getWarehouseById")
    public R<List<SysUserPermissionWarehouseVo>> getWarehouseById(@RequestParam(name = "id") Long id,
                                                                  @RequestParam(name = "selected") String selectWidType,
                                                                  @RequestParam(name = "keywords", required = false) String keywords) {
        List<SysUserPermissionWarehouseVo> list = sysUserPermissionWarehouseService.getList(id, selectWidType, keywords);
        return R.data(list);
    }

}
